@video-prefix: ~'@{gx-prefix}-video';

.@{video-prefix} {
  &-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    background-color: #000;

    video {
      width: 100%;
      height: 100%;
      background-color: #000;
    }

    &:hover {
      .@{video-prefix}-dashboard {
        opacity: 1;
      }
    }
  }

  &-dashboard {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 11;
    width: 100%;
    height: 49px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: all 0.2s ease-in-out;
  }

  &-controls {
    position: absolute;
    bottom: 5px;
    left: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 40px;
    padding: 0 20px;
    text-align: left;
    box-sizing: border-box;

    &-playback {
      display: flex;
      gap: 15px;
      align-items: center;

      .@{video-prefix}-playback-time {
        font-size: 13px;
        line-height: 30px;
        color: #fff;
      }

      .icon {
        font-size: 20px;
        color: #dcdcdc;
        cursor: pointer;
      }
    }

    &-volume {
      position: relative;
      display: inline-block;
      height: 45px;
      line-height: 45px;

      &:hover {
        .@{video-prefix}-controls-volume-panel {
          display: block;
        }
      }

      &-panel {
        position: absolute;
        bottom: 44px;
        left: 50%;
        box-sizing: border-box;
        display: none;
        width: 28px;
        height: 130px;
        min-height: 30px;
        font-weight: 500;
        background-color: rgba(0, 0, 0, 0.54);
        border-radius: 4px;
        transform: translateX(-50%);

        .progress {
          position: absolute;
          top: 50%;
          left: 50%;
          width: 4px;
          height: 100px;
          margin-top: -50px;
          margin-left: -2px;
          cursor: pointer;
          background-color: rgba(255, 255, 255, 0.7);

          .volume-current {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 0;
            background-color: var(--gx-primary-color);
          }

          .thumb-drag {
            position: absolute;
            top: 0;
            left: 50%;
            width: 10px;
            height: 10px;
            background-color: #fff;
            border-radius: 5px;
            opacity: 0;
            transition: height 0.05s ease 0.15s;
            transform: translateY(-50%) translateX(-50%);

            &::before {
              position: absolute;
              top: -2px;
              left: -2px;
              display: inline-block;
              width: 14px;
              height: 14px;
              content: '';
              background-color: rgba(255, 255, 255, 0.3);
              border-radius: 7px;
            }
          }

          &:hover {
            .thumb-drag {
              opacity: 1;
            }
          }
        }
      }
    }

    &-settings {
      display: flex;
      gap: 15px;
      align-items: center;

      .icon {
        font-size: 20px;
        color: #dcdcdc;
        cursor: pointer;
      }
    }

    &-backdrop {
      &_filter {
        position: absolute;
        z-index: 20;
        backdrop-filter: saturate(180%) blur(20px);
        background-color: #000000b3;
        border-radius: 3px;
        font-size: 13px;
        transition: all 0.2s;
        bottom: 50px;
        right: 10px;
        overflow: auto;
      }
    }
  }

  &-settings {
    &-panel {
      display: none;

      &_current {
        display: block;
      }

      &_back {
        border-bottom: 1px solid #ffffff1a;
      }

      &_item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 35px;
        cursor: pointer;
        color: #fff;
        padding: 0 5px;
        line-height: 1;
        overflow: hidden;

        &.@{video-prefix}-settings-panel_current {
          color: #fff;
          background-color: #ffffff1a;

          .icon.icon-check {
            visibility: visible;
          }
        }

        .icon {
          font-size: 16px;
          color: #fff;
        }

        .icon.icon-check {
          margin-right: 10px;
          visibility: hidden;
        }

        .@{video-prefix}-settings-panel_item_left {
          display: flex;
          align-items: center;
          gap: 10px;
        }

        .@{video-prefix}-settings-panel_item_right {
          display: flex;
          align-items: center;
          gap: 5px;

          &_tooltip {
            white-space: nowrap;
            font-size: 12px;
          }
        }
      }
    }

    &-switch {
      display: inline-block;
      position: relative;
      width: 45px;
      height: 16px;
      border-radius: 8px;
      background-color: #fff;
      cursor: pointer;

      &::after {
        content: '';
        display: inline-block;
        position: absolute;
        top: 1px;
        left: 2px;
        width: 14px;
        height: 14px;
        border-radius: 7px;
        background-color: #00000040;
        transition: left 0.2s ease-in 0.05s;
      }

      &.open {
        &::after {
          left: 29px;
          background-color: var(--gx-primary-color);
        }
      }
    }
  }

  &-progress {
    &-wrapper {
      position: absolute;
      bottom: 100%;
      left: 0;
      width: 100%;
      height: 12px;
      cursor: pointer;

      &:hover {
        .@{video-prefix}-progress-container {
          height: 6px;

          .@{video-prefix}-progress-thumb-drag {
            opacity: 1;
          }
        }
      }
    }

    &-container {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 4px;
      background-color: rgba(255, 255, 255, 0.3);
      transition: height 0.2s ease 0.05s;
    }

    &-playered,
    &-loaded {
      position: absolute;
      top: 0;
      left: 0;
      width: 0;
      height: 100%;
      background-color: rgba(255, 255, 255, 0.7);
    }

    &-loaded {
      transition: width 0.1s cubic-bezier(0.4, 0, 1, 1);
    }

    &-playered {
      width: 0;
      background-color: var(--gx-primary-color);
    }

    &-thumb-drag {
      position: absolute;
      top: 50%;
      right: 0;
      width: 12px;
      height: 12px;
      background-color: #fff;
      border-radius: 6px;
      opacity: 0;
      transition: height 0.05s ease 0.15s;
      transform: translateY(-50%) translateX(50%);

      &::before {
        position: absolute;
        top: -2px;
        left: -2px;
        display: inline-block;
        width: 16px;
        height: 16px;
        content: '';
        background-color: rgba(255, 255, 255, 0.3);
        border-radius: 7px;
      }
    }
  }

  &-mask {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 11;
    width: 100%;
    height: 100%;
  }

  &-layer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    font-weight: normal;
    color: #fff;
  }

  &-loading {
    z-index: 16;

    &-wrapper {
      position: absolute;
      top: 50%;
      left: 50%;
      text-align: center;
      transform: translate(-50%, -50%);

      .playerfont {
        font-size: 30px;
        color: var(--gx-primary-color);
        transform: rotate(45deg);
        animation: antrotates 1.2s infinite linear;
      }
    }
  }

  &-error {
    z-index: 18;
    background-color: #333;

    &-wrapper {
      position: absolute;
      top: 50%;
      left: 50%;
      text-align: center;
      transform: translate(-50%, -50%);

      &_title {
        color: #fff;
      }
    }
  }

  &-play-pause {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    font-weight: normal;
    color: #fff;
  }
}
